from app.enums.result_code import ResultCode

from .base import AppException


class UserNotFoundException(AppException):
    """用户未找到异常"""

    def __init__(self):
        super().__init__(result_code=ResultCode.USER_NOT_EXIST)


class UserAccountFrozenException(AppException):
    """用户账号已被冻结异常"""

    def __init__(self):
        super().__init__(result_code=ResultCode.USER_ACCOUNT_FROZEN)


class UserDuplicateException(AppException):
    """用户重复异常"""

    def __init__(self):
        super().__init__(result_code=ResultCode.USERNAME_ALREADY_EXISTS)


class InvalidTokenException(AppException):
    """无效令牌异常"""

    def __init__(self):
        super().__init__(result_code=ResultCode.ACCESS_TOKEN_INVALID)


class InvalidRefreshTokenException(AppException):
    """无效刷新令牌异常"""

    def __init__(self):
        super().__init__(result_code=ResultCode.REFRESH_TOKEN_INVALID)
